﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ppt = Microsoft.Office.Interop.PowerPoint;

namespace ObjectModel.PowerPoint
{
    public static class SlideExtensions
    {
        public static Ppt.Presentation GetPresentation(this Ppt.Slide slide)
        {
            // Note: this may need to be revised to something more robust, e.g. return slide.GetParent<Ppt.Presentation>();
            return slide.Parent as Ppt.Presentation;
        }

        public static SlideEvents GetEvents(this Ppt.Slide slide)
        {
            Ppt.Presentation pres = slide.GetPresentation();

            return Globals.PresentationEvents[pres].SlideEvents[slide.SlideID];
        }
    }
}
